package com.tmt.oss;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;

import com.swak.oss.OssConfig;
import com.swak.utils.Maps;

/**
 * Oss 基本配置
 * 
 * @author lifeng
 */
public class OssConfigImpl implements OssConfig {

	private URI endpoint;
	private String accessKeyId;
	private String accessKeySecret;
	private Map<String, Bucket> buckets;

	public OssConfigImpl() throws URISyntaxException {
		this.endpoint = new URI("https://xxx.aliyuncs.com");
		this.accessKeyId = "xxx";
		this.accessKeySecret = "xxx";
		this.buckets = Maps.newHashMap();
		this.buckets.put("audio/mpeg", Bucket.newBucket("name", "http://audio.xxx.vip", false));
		this.buckets.put("video/mp4", Bucket.newBucket("name", "http://video.xxx.vip", false));
		this.buckets.put("application/octet-stream", Bucket.newBucket("name", "http://oss.xxx.vip", false));
		this.buckets.put("image/jpeg", Bucket.newBucket("name", "http://image.xxx.vip", false));
		this.buckets.put("image/png", Bucket.newBucket("name", "http://image.xxx.vip", false));
		this.buckets.put("temp", Bucket.newBucket("temp-0755", "http://temp.xxx.vip", false));
	}

	public URI getEndpoint() {
		return endpoint;
	}

	public String getAccessKeyId() {
		return accessKeyId;
	}

	public String getAccessKeySecret() {
		return accessKeySecret;
	}

	public Map<String, Bucket> getBuckets() {
		return buckets;
	}
}